function Entrance(x, y, delay, total) {
	this.sprite;
	this.x = x;
	this.y = y;
	this.width = 40;
	this.height = 40;
	this.delay = delay;
	this.total = total;
	this.released = 0;
	this.counter = 0;
	
	this.draw = function(context) {
		context.strokeRect(this.x, this.y, this.width, this.height);
	};
	
	this.step = function(world) {
		var droidsLeft = total - this.released;
		if (droidsLeft > 0 && this.counter % this.delay == 0) {
			world.addDroid(this.x, this.y);
			this.released++;
		}
		this.counter++;
	};
}

function Exit(x, y) {
	this.sprite;
	this.x = x;
	this.y = y;
	this.width = 40;
	this.height = 40;
	this.saved = 0;
	
	this.draw = function(context) {
		context.strokeRect(this.x, this.y, this.width, this.height);
	};
	
	this.step = function(world) {
		for (var i=0; i < world.droids.length; i++) {
			var droid = world.droids[i];
			if (overlaps(droid.x, droid.y, droid.width, droid.height, this.x, this.y, this.width, this.height)) {
				world.removeDroid(droid);
				this.saved++;
			}
		}
	};
	
}